Mac系统清理

查看系统的文件占用详情

1
2
3
4
5
6
方法:
Step 1: 查看整个电脑的文件大小分布,命令:du -sh *
Step 2: 查看较大的文件,定位到较大文件下
1)cd ~/Library
2) du -d 1 -h
Step 3: 有针对性的删除文件

一、首先打开终端,输入命令

1
du -sh *

这个命令用来查看根目录下所有文件的大小分布, 下图所示:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
CNWUXNBMAC1504:~ guh4$ du -sh *
0B -
0B -help
1.0M Applications
22G Desktop
5.2M Documents
20K Downloads
8.6G Library
0B Movies
240M Music
85M Pictures
8.0K Public
20M PycharmProjects
0B debug.log
1.7M get-pip.py
0B getmacapps_temp
0B hf.txt
8.0K time.txt
CNWUXNBMAC1504:~ guh4$

其中,可以很容易能看到每个文件的大小占比,快速定位到Library文件。

输入命令,进入到Library文件路径

1
cd ~/Library
1
2
CNWUXNBMAC1504:~ guh4$ cd ~/Library
CNWUXNBMAC1504:Library guh4$

然后,查看Library下所有文件大小分布
输入:

1
du -d 1 -h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
CNWUXNBMAC1504:Library guh4$ du -d 1 -h
92K ./Receipts
2.6G ./Application Support
3.1M ./Assistant
8.0K ./Autosave Information
1.6M ./Saved Application State
184K ./IdentityServices
140K ./WebKit
595M ./Developer
11M ./Calendars
2.9M ./Preferences
16K ./studentd
1.2M ./Messages
1.2M ./HomeKit
8.0K ./DES
18M ./Keychains
8.0K ./Sharing
1.4G ./Eudb_en
0B ./ColorPickers
0B ./Application Scripts
0B ./Assistants
0B ./Python
15M ./Mail
0B ./Compositions
0B ./GameKit
24K ./Google
256K ./LanguageModeling
0B ./Favorites
428K ./Passes
28K ./Edraw
0B ./Family
0B ./iTunes
0B ./iMovie
236K ./Library
8.0K ./FontCollections
0B ./Sounds
92K ./Personas
44K ./com.apple.internal.ck
412K ./Printers
888K ./SyncedPreferences
0B ./Audio
0B ./Keyboard Layouts
8.0K ./Logs
0B ./Internet Plug-Ins
80K ./FrontBoard
0B ./Voices
0B ./News
3.5M ./Accounts
49M ./Safari
0B ./Colors
0B ./PreferencePanes
24K ./FileProvider
1.5M ./Mobile Documents
200K ./PubSub
11M ./Suggestions
16K ./LaunchAgents
874M ./Group Containers
296K ./Dictionaries
2.9G ./Containers
0B ./ScreenRecordings
61M ./Atlas
648K ./sapi
8.0K ./PersonalizationPortrait
0B ./Fonts
41M ./XMind
2.1M ./KeyboardServices
3.8M ./Metadata
0B ./Screen Savers
0B ./CallServices
12K ./Spelling
0B ./SafariSafeBrowsing
0B ./Input Methods
136K ./Cookies
16K ./Services
20K ./Keyboard
28K ./CoreFollowUp
30M ./Caches
8.6G .
CNWUXNBMAC1504:Library guh4$

按照上述方法,查看容量较大的文件夹,再查看文件大小分布

Reference:

  1. Mac系统清理、占用空间大、空间不够、查看系统文件大小分布, https://www.cnblogs.com/yajunLi/p/7008578.html
0%